#pragma once

#include <iostream>
#include <tchar.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include "CgProgram.h"
#include "FluidGridSimulator.h"
#include "math.h"
#include "glinfo.h"
#include "glutwindow.h"
#include "RenderTexture.h"

typedef struct{
	float x, y, z;
}CameraPos;

class CSmoke3DFlatWin: public cwc::glutWindow
{
public:
	CSmoke3DFlatWin(int w, int h);
	~CSmoke3DFlatWin(void);
	virtual	void	OnRender(void);
	virtual	void	OnIdle(void);							//process during idle, compute next time step smoke situation here
	virtual	void	OnPreDisplay();								//initialize before render, called only once
	virtual	void	OnResize(int nWidth, int nHeight);
	virtual	void	OnClose();
	virtual	void	OnMouseDown(int button, int x, int y);
	virtual void	OnMouseUp(int button, int x, int y);
	virtual	void	OnMouseMove(int x, int y, int mod);
	virtual	void	OnKeyDown(int nKey, char cAscii);
	virtual	void	OnKeyUp(int nKey, char cAscii);

protected:
	void OnInit();
	void drawText(char* str, void* font, GLclampf r, GLclampf g, GLclampf b, GLfloat x, GLfloat y);
	void addAutoSources();

	FluidGridSimulator* fluidSimulator;

	bool g_show_HUD;

	cwc::glInfo m_glInfo;

	CameraPos m_CameraPos[3000];
	int m_numCameraPos;
	int m_CameraPosId;
};